<%@page import="com.tubeonfire.entity.Page"%>
<%@page import="com.tubeonfire.model.admin.PageModel"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	PageModel model = (PageModel)request.getAttribute("result");		
	String url = (String)request.getAttribute("url");
	List<Page> list = model.getListResult();		
%>
<jsp:include page="/admin/elements/header.jsp">
	<jsp:param value="Page Manager" name="title"/>
</jsp:include>
<script type="text/javascript" src="/admin/js/mine/list_page.js"></script>
<script type="text/javascript" src="/admin/js/custom/tables.js"></script>
<script type="text/javascript" src="/admin/js/custom/general.js"></script>
	<body class="loggedin">
		<jsp:include page="/admin/elements/top.jsp"/>
	    <!-- START OF MAIN CONTENT -->
	    <div class="mainwrapper">
	     	<div class="mainwrapperinner">  	     		       	       
				<jsp:include page="/admin/elements/left.jsp">
					<jsp:param value="page" name="current_page"/>
				</jsp:include>					              	                   
	        	<div class="maincontent noright">
	        		<div class="maincontentinner">	
        				<ul class="maintabmenu multipletabmenu">
		                	<li class="current"><a href="/admin/page/list">Manage Page</a></li>
		                    <li><a href="/admin/page/add">New Page</a></li>		                    
		                </ul>            			               
		                     
	                	<div class="content">	
	                	<jsp:include page="/admin/elements/message.jsp"/>	
	                	<div id="messageDiv" class="notification hidden">						   
						    <p></p>
						</div>	                			                	    	                   
	                    	<div class="contenttitle">
	                    		<h2 class="image"><span>List Page</span></h2>
	                    	</div>
	                    	<div class="tableoptions">			                	
			                    <select class="radius3 action" id="action">			  
			                    	<option value="0">Select action</option>                  	
			                    	<option value="1">Delete all checked page</option>				                    			                    
			                    </select> &nbsp;
			                    <button class="radius3" id="applyChange">Apply</button>			                  
			                    <small class="desc" style="float: right;">(Tips)</small>		                    	
			                </div>						                          
		                    <table id="table-result" cellpadding="0" cellspacing="0" border="0" class="stdtable stdtablecb">		                    
			                    <colgroup>
			                        <col class="con0">
			                        <col class="con1">
			                        <col class="con0">			                      
			                        <col class="con1">
			                        <col class="con0">			                        
			                    </colgroup>
			                    <thead>
			                        <tr>
			                        	<th class="head0"><span class="checkbox"><input type="checkbox" class="checkall"></span></th>
			                            <th class="head1">Type</th>
			                            <th class="head0">Title</th>			                            		                            
			                            <th class="head1">Status</th>
			                          	<th class="head0">Action</th>
			                        </tr>
			                    </thead>
			                    <tfoot>
			                        <tr>
			                        	<th class="head0"><span class="checkbox"><input type="checkbox" class="checkall"></span></th>
			                            <th class="head1">Thumb</th>
			                            <th class="head0">Title</th>			                            	                           
			                            <th class="head1">Status</th>
			                          	<th class="head0">Action</th>
			                        </tr>
			                    </tfoot>
			                    <tbody>
			                    <%
				                	if(list!=null&&list.size()>0){				               								
										for(Page obj: list){																			
									%>
				                        <tr>
				                        	<td class="center"><span class="checkbox"><input type="checkbox" value="<%=obj.getId()%>"></span></td>
				                            <td class="center">
				                            	<%
				                            		if(obj.getType()==1){
				                            			%>
				                            				Content Page
				                            			<%
				                            		}else{
				                            			%>
				                            				Video Page
				                            			<%
				                            		}
				                            	%>	
				                            </td>
				                            <td class="center"><%=obj.getTitle() %></td>				                            				                            
				                            <td class="center status">
				                            	<%=obj.getStatus()==1?"Active":"Deactive" %>
				                            </td>				                           
				                            <td class="center">		
				                            	<%
				                            		if(obj.getStatus()==1){
				                            			%>
			                            		<a class="stdbtn btnDeactive btnStatus" target="blank" href="<%=obj.getId()%>" title="Deactive Page">Deactive</a>		
				                            			<%
				                            		}else{
				                            			%>
				                            	<a class="stdbtn btnActive btnStatus" target="blank" href="<%=obj.getId()%>" title="Active Page">Active</a>
				                            			<%
				                            		}
				                            	%>		                            	 				                            
				                            	<a class="stdbtn" href="/admin/page/edit?id=<%=obj.getId()%>" title="Edit Page">Edit</a>
				                            	<a class="stdbtn btnDelete" target="blank" href="<%=obj.getId()%>" title="Delete Page">Delete</a> 				                            					                            
				                            </td>
				                        </tr>
			                        <%
										}	
				                	}
			                        %>			                        		                       
			                    </tbody>
			                </table>   
		                                                          
	                    	<br clear="all" />	   	                    	
	                </div>
	               
	                <!--content-->	                
	            </div><!--maincontentinner-->
				<jsp:include page="/admin/elements/bottom.jsp"></jsp:include>                    	           	
	        </div><!--maincontent-->	                        
	     	</div><!--mainwrapperinner-->
	    </div><!--mainwrapper-->
		<!-- END OF MAIN CONTENT -->   
		<div id="opacity"></div>
		<img id="image_loadder" src="/admin/images/ajax-loader.gif">     
	</body>
</html>
